package hcn.protocol.brandnew.zhenliao.yaopin;

import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateTimeAdapter;
import lombok.Data;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;
import java.util.List;


/**
 * 门诊审方列表查询-响应消息(失败) - ODS_03040007_SUC
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "Data")
@XmlAccessorType(XmlAccessType.FIELD)
public class ListRecordResponse {

    /**
     * 处方信息
     */
    @XmlElementWrapper(name = "PrescriptionLists")
    @XmlElement(name = "PrescriptionList")
    private List<PrescriptionList> prescriptionLists;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class PrescriptionDrug {

        /**
         * 药品名称
         */
        @XmlElement(name = "DrugName")
        private String drugName;
        /**
         * 药品编码
         */
        @XmlElement(name = "DrugsNumber")
        private String drugsNumber;
        /**
         * 药品规格
         */
        @XmlElement(name = "DrugSpecifications")
        private String drugSpecifications;
        /**
         * 单位/药房单位
         */
        @XmlElement(name = "DrugstoreUnit")
        private String drugstoreUnit;
        /**
         * 剂量/一次剂量
         */
        @XmlElement(name = "OnceDosage")
        private String onceDosage;
        /**
         * 剂量单位
         */
        @XmlElement(name = "DosageUnit")
        private String dosageUnit;
        /**
         * 药品用法名称
         */
        @XmlElement(name = "DrugUsePathwaysName")
        private String drugUsePathwaysName;
        /**
         * 用药频次名称
         */
        @XmlElement(name = "DrugUsingRateName")
        private String drugUsingRateName;
        /**
         * 药品数量
         */
        @XmlElement(name = "DrugSendNumber")
        private String drugSendNumber;
        /**
         * 药品煎法名称
         */
        @XmlElement(name = "HerbalMedicineDecoctionName")
        private String herbalMedicineDecoctionName;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class PrescriptionList {

        /**
         * 处方记录id
         */
        @XmlElement(name = "PrescriptionRecordId")
        private String prescriptionRecordId;
        /**
         * 患者姓名
         */
        @XmlElement(name = "Name")
        private String name;
        /**
         * 患者性别名称
         */
        @XmlElement(name = "Sex")
        private String sex;
        /**
         * 患者年龄
         */
        @XmlElement(name = "Age")
        private Short age;
        /**
         * 处方日期
         */
        @XmlElement(name = "PrescriptionDate")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date prescriptionDate;
        /**
         * 处方号码
         */
        @XmlElement(name = "RecipeNumber")
        private String recipeNumber;
        /**
         * 药房代码
         */
        @XmlElement(name = "PharmacyId")
        private String pharmacyId;
        /**
         * 科室名称
         */
        @XmlElement(name = "VisitDeptName")
        private String visitDeptName;
        /**
         * 科室代码
         */
        @XmlElement(name = "VisitDeptId")
        private String visitDeptId;
        /**
         * 审核状态
         */
        @XmlElement(name = "AuditStatus")
        private Byte auditStatus;
        /**
         * 处方类型
         */
        @XmlElement(name = "PrescriptionType")
        private Byte prescriptionType;
        /**
         * 处方帖数
         */
        @XmlElement(name = "PiecesChineseMedicineAgentNumb")
        private Byte piecesChineseMedicineAgentNumb;
        /**
         * 代煎标志
         */
        @XmlElement(name = "BoilSign")
        private Byte boilSign;
        /**
         * 药品列表
         */
        @XmlElementWrapper(name = "PrescriptionDrugs")
        @XmlElement(name = "PrescriptionDrug")
        private List<PrescriptionDrug> prescriptionDrugs;
    }

}
